//
//  textFieldView.m
//  XYMaterial
//
//  Created by 肖扬 on 16/1/12.
//  Copyright © 2016年 肖扬. All rights reserved.
//

#import "textFieldView.h"

@implementation textFieldView
@synthesize tempLab,textField,tempLab1,modelId;
-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.tempLab = [[UILabel alloc]initWithFrame:CGRectMake(10, (frame.size.height - 20)/2, 70, 20)];
        tempLab.font = [UIFont systemFontOfSize:12];
        [tempLab setBackgroundColor:[UIColor clearColor]];
        [tempLab setTextColor:UIColorFromRGB(0x333333)];
        [self addSubview:tempLab];
        
        self.tempLab1 = [[UILabel alloc]initWithFrame:CGRectMake(SWIDTH - 60, (frame.size.height - 20)/2, 50, 20)];
        tempLab1.font = [UIFont systemFontOfSize:12];
        tempLab1.textAlignment = NSTextAlignmentRight;
        [tempLab1 setBackgroundColor:[UIColor clearColor]];
        [tempLab1 setTextColor:UIColorFromRGB(0x333333)];
        [self addSubview:tempLab1];
        
        self.textField= [self createTextFieldFrame:CGRectZero bgColor:UIColorFromRGB(0xd2d2d2) tag:0 keyBoardType:0];
        [self addSubview:self.textField];
    }
    return self;
}
- (UITextField *)createTextFieldFrame:(CGRect)frame
                              bgColor:(UIColor *)color
                                  tag:(NSInteger)tag
                         keyBoardType:(int)keyBoardType{
    UITextField *tempTextField = [[UITextField alloc]initWithFrame:frame];
    tempTextField.backgroundColor = [UIColor clearColor];
    tempTextField.textColor = color;
    tempTextField.tag = tag;
    tempTextField.keyboardType = keyBoardType;
    tempTextField.font = [UIFont systemFontOfSize:12];
    return tempTextField;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
